package com.tsj.SpringBoot.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.tsj.SpringBoot.dao.UserDao;
import com.tsj.SpringBoot.service.TestService;
import com.tsj.SpringBoot.vo.User;

@RequestMapping("/user")
@RestController
public class UserController {
	private static final Logger logger = LoggerFactory.getLogger(UserController.class);
	@Autowired
	public UserDao userDao;
	@Resource
	TestService testService;
	
	
	
	@GetMapping("/userList")
	public Map<String,Object> userList(){
		Map<String, Object> map =new HashMap<String, Object>();
		List<User> userList = userDao.userList();
		map.put("userList", userList);
		logger.debug("debug 日志");
		logger.info("info 日志");
		return map;
	}
	@RequestMapping("/userServiceTest")
	public void userServiceTest() {
		testService.test();
		
	}
	
}
